home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
EDITORS
/
ZAP
/
!Zap
/
!Help
< prev
next >
Wrap
Text File
|
1996-10-12
|
65KB
|
1,469 lines
*****************************************************************************
* >!Help file for Zap version 1.30 *
* Copyright Dominic Symes 1992-1996. See 'Copyright' file. *
*****************************************************************************
ZAP is a text editor
Main features: * Display may be in many different editing modes. Eg:
Text, byte, disassembly, coloured C, assembler, Basic.
* All key short cuts and menus are user redefinable.
* Full (unix style) wildcard search with your own definable
macros and search 'throwback' buffers.
* Proper unix tabs and true scrollbar operation.
* Full undo on all operations.
* Copy/End key causes standard cursor editing.
* Fast redraw in bitmap or anti-aliased fonts. Lots of
different bitmap fonts supplied.
* Any number of markers on each file, and a facility for
following branches in disassembly mode.
* Full ARMBE style BASIC Editor.
* Search as you type with minibuffer.
* Learns keys sequences.
* Emacs style Yank (Cut & Paste) and !Edit style move and
copy implemented.
* C throwback/info supported.
* Reads disc sectors/tracks and memory of other tasks.
* Keyboard selection of regions.
* Taskwindow supports control characters / line-editor.
* Emacs compatible keymap.
* Auto indent.
* Can edit assembler instructions when in code mode.
* Compatible with Risc Os 2 & 3 & Risc PC.
* Automatic detection of DOS text files and Spool files.
* Uses dynamic areas on the Risc PC.
*************************************************************************
* Important: *
*************************************************************************
(1) If you find this help file too technical, then please look in the
ZapPrimer directory (in the 3rdParty directory). This contains a
'beginners manual', aimed at those used to 'Edit'.
Thanks to David Holden for writing this.
(2) This file does NOT contain help on the menu items and dialogue
boxes. See the Docs.Helpdata file or run the !Help application (in
Resources:Apps) to find out about these.
(3) The 3rdParty extension modes each have their own help file in the
3rdParty directory.
(4) If you are changing versions of Zap then please read the 'Changes'
file first!
*************************************************************************
* Contents: *
*************************************************************************
Section A Keys and options.
A.1 Summary of default key & mouse actions.
A.2 How to (re)define more keys.
A.3 How to change Zap's default options.
A.4 Differences RISCOS 2/3/3.5.
A.5 Multiple keymaps / the Emacs keymap.
A.6 Colour and changing the default colours.
Section B Loading/saving/printing/editing files
B.1 Loading files/creating files.
B.2 Saving files and ~ backups.
B.3 Dumping/printing files.
B.4 Selecting regions.
B.5 Copying/cutting/pasting/yanking.
B.6 Inserting text/control codes
Section C Editing BASIC - PLEASE READ
C.1 How to change editors/options.
C.2 Using BASIC in ARMBE mode.
C.3 Testing BASIC programs.
C.4 The cln_Backward error.
Section D Individual mode help.
D.0 Text mode
D.1 Byte mode .. etc ..
Section E Search and Replace.
E.1 The Search window.
E.2 The Replace window.
E.3 Keyboard (incremental) search.
Section F Other features.
F.1 Learning key sequences - very useful.
F.2 Tabs and indenting.
F.3 Fonts and font sizes.
F.4 Universal arguments.
F.5 The minibuffer
Section G How to find out more.
G.1 Other help files - MENU help.
G.2 Obtaining future versions of Zap.
G.3 Contacting me with suggestions/bugs.
*************************************************************************
* Section A: Keys and options. *
*************************************************************************
A.1 Default key actions
-----------------------
When Zap is loaded, it reads in the 'keys' file, and uses this to create the
current key bindings. Many other options are also stored in this file. See
section A.3 for more details. Each key mentioned in the 'keys' file has a
command name following it. By editing the file and moving the command names
about, you can change the action of any key. See section A.2 for more details
(the format of a 'keys' file entry and how to define multiple keymaps).
Please note that the key short cuts given in the menus are automatically
updated to reflect your new choice of keys (for whatever you have set as the
default keymap). A summary of the default key bindings is given below.
(s=Shift c=Ctrl sc=Shift+Ctrl).
Key: Command: Action:
Return RETURN Splits line / inserts new line in line edit
mode. Also indents in auto-indent mode.
Edits an instruction in code mode.
sReturn RETURN As above.
cReturn RETURNNOINDENT As RETURN except doesn't auto-indent.
Delete DELETE Delete last character.
sDelete DELETENEXT Delete next character.
cDelete DELLINE Delete current line.
scDelete DELTOEND Delete to end of line.
Tab TAB Inserts a variety of tabs - see tab menu.
sTab SWITCHTAB Switches between Unix and !Edit tab modes.
cTab - Reserved for !Larger/!Menon users.
Escape ESCAPE Stops copy modes/selection modes/search
as you type mode/yank mode.
sEscape CANCEL Cancel operation and return to start posn.
cEscape COMMAND Brings up a minibuffer in which you can type
any Zap command. Equivalent of Emacs M-X.
<-| DELETE Delete last character.
s<-| DELETE Delete last character.
c<-| FASTUNDO Undo last operation.
sc<-| LASTMARK Jump to last marker
Copy COPY Initiates split cursor copying. Move cursor
with cursor keys and use COPY key to copy.
Note that you may copy from one window to
another by pressing SELECT on the other.
sCopy COPY For those who wish to redefine Copy to be
DELETENEXT. Copy key still ok in copy mode.
cCopy SELREGION Starts selection of a region via cursor keys.
Press Escape/cCopy to end the selection.
scCopy DUMPFILE Produce text version of the display.
Insert TOGGLEINSERT Toggle insert and overwrite modes.
Print QUICKPRINT Send file directly to printer.
sPrint PRINTFILE Print file through printer driver.
cPrint OPENPRINTER Open 'printer:$' filer window.
scPrint CLOSEPRINTER Close 'printer:$' filer window.
Space bar CHAR &20 Inserts a space.
sSpace CHAR &20 As above.
cSpace SELREGION Emacs compatible.
scSpace UNSPACE Remove excess spacing around the cursor.
Cursor keys:
Left LEFT Moves 1 left / goto last mark in code mode.
Right RIGHT Moves 1 right / goto address in code mode.
Down DOWN Move 1 line down.
Up UP Move 1 line up.
sLeft SLEFT Move back one word.
sRight SRIGHT Move forward one word.
sDown/PageDown SDOWN Move down a page.
sUp/PageUp SUP Move up a page.
cLeft CLEFT Move to start of logical line.
cRight CRIGHT Move to end of logical line.
cDown CDOWN Move to end of text (and leave marker).
cUp CUP Move to start of text (and leave marker).
scLeft SCLEFT Move to the left without moving cursor.
scRight SCRIGHT Move to the right without moving cursor.
scDown SCDOWN Move down without moving cursor.
scUp SCUP Move up without moving cursor.
Function keys:
F1 EXECUTE Execute learnt key sequence (see F.1).
F2 FINDFILE Load a named file (Emacs C-X C-F).
F3 SAVE Brings up save box. See save box help.
F4 SEARCHCUR Brings up Search to cursor box. (See E.1).
F5 GOTO Brings up Goto line/address box.
F6 TOGGLEMARK Inserts marker in text/deletes marker.
F7 SEARCHBUF Brings up Search to buffer box. (See E.1)
F8 FULLUNDO Full undo (takes longest path in undo tree).
F9 REDO Redo (undo last undo whether full or fast).
F10 DELLINE Delete current line.
sF1 SPLITLINE Split line (useful in Basic mode).
sF2 SWAPWINDOW Swap window (to next window/last used).
sF3 HEXASCII Toggles hex entry mode when byte/word modes.
sF4 REPLACE Brings up search and replace box. (See E.2).
sF5 NULL Reserved.
sF6 LASTMARK Last mark (eg after ctrl-down by mistake).
sF7 NEXTMATCH Next match (after an F4 or F7 search).
sF8 RENUMBER Renumbers a BASIC file.
sF9 NEXTMARK Jump to next set marker.
sF10 DELTOSTART Delete to start of line.
cF1 JOINLINE Join line (useful in Basic mode).
cF2 CLOSEWINDOW Close current window (and jump to next).
cF3 QUICKSAVE Save the file with no prompt.
cF4 NEWVIEW New view (open new window on this file).
cF5 WORDWRAP Toggle wordwrap mode (w in title).
cF6 FORMATTEXT Format text to start of next paragraph.
cF7 LASTMATCH Previous match (see sF7).
cF8 BINDTOKEY Bind the learnt sequence (see cL) to a key.
cF9 SAVESEL Open the 'save selection' window.
cF10 DELTOEND Delete to end of line (emacs style ctrl K).
scF1 MODEN "Text" Text mode (display in text format)
scF2 MODEN "Byte" Byte mode (display in hex bytes)
scF3 MODEN "Word" Word mode (display in hex words)
scF4 MODEN "Ascii" Ascii mode (display in characters)
scF5 MODEN "Code" Code mode (display in disassembled code)
scF6 MODEN "Basic" BASIC mode (display tokenised Basic)
scF7 MODEN "Bastxt" BASTXT mode (display detokenised Basic)
scF8 MODEN "Softwrap" Softwrap mode - soft line endings.
scF9 MODEN "C" Colour C mode.
scF10 MODEN "Assembler" Colour Acorn assembler mode.
Ctrl letters:
cA CLEFT Start of line (emacs compatible)
cB LEFT Back a character (emacs compatible)
cC COPYSEL Copy selected region to current position.
cD DELETENEXT Delete next char (emacs compatible)
cE CRIGHT Go to line end (emacs compatible)
cF RIGHT Forward a char (emacs compatible)
cG CANCEL Cancel search 'as you type' and return to
start. Also cancel any yank operations.
Escape from minibuffer. (emacs compatible)
cH HELP Get help on Zap, a key, Zap command or mode.
cI INDIRECT Indirect (move to the address given by word
at cursor - useful in Code mode).
cJ INDENT Indent selection by string (see selection
menu).
cK DELTOEND Kill line (emacs compatible)
cL LEARN Learn key sequence (see F.1).
cM RETURN Performs return action for current mode.
cN DOWN Next line (emacs compatible)
cO TOFRONT Bring editor window to front of windows.
cP UP Previous line (emacs compatible)
cQ QUOTE Insert next character into text (even if it
is a ctrl character. eg cQ,cA inserts #1).
cR SEARCHBACK Reverse search 'as you type'.
cS SEARCHFORWARD Search 'as you type' forwards.
cT SELECTBUFFER Select entire buffer.
cU UNIVERSALARG Perform next instruction 'n' times. Eg
cU 4 RETURN A inserts 4 A's.
cV MOVESEL Move selected region to current position.
cW SETWIDTH Set the window width.
cX CUT Delete/Cut selected region.
cY PASTE Paste/Yank once selected region.
cZ CLEARSEL Clear selection.
c[ OSCLI Execute an operating system * command.
scA LINENOS 3 Addresses shown at line start.
scB BASIC Drop into Basic with program downloaded.
scC COMPILE Saves then chains/compiles a program.
scD INSERTDATE Insert current date (format in 'keys' file).
scE SAVEANDRUN Saves then runs a program then exits.
scF RUNANDQUIT Runs a program and then exits.
scG TOGGLEWIND Toggle window size.
scH LISTFNS List function definitions.
scI NEXTTRACK Move forward one track.
scJ LASTSECTOR Move back one sector.
scK NEXTSECTOR Move forward one sector.
scL LINENOS 1 Logical line numbers shown at line start.
scM LASTTRACK Move back one track.
scN NOLINENOS Removes line numbers/addresses.
scO TOGGLEHEX Line numbers shown in hex/decimal.
scP PHYSICAL Physical line numbers shown at line start.
scQ SWAPCHARS Swap next two characters around.
scR READONLY Toggle read only state (r in title).
scS SWAPCASE Swap case of next character/selected region.
scT INSERTTIME Insert current time (format in 'Keys' file).
scU RUN Run a basic program from memory.
scV - Reserved.
scW KEEPREGION Put selected region into yank buffer.
scX CLOSEOTHER Close other open window.
scY YANK Yank cyclically through deleted regions.
scZ KEYMAP 1 Emacs prefix key (eg scZ ESC X).
sc- (c_) FULLUNDO Undo (emacs compatible)
Standard mouse actions:
Click SELECT: Place cursor at the clicked position.
Click MENU : Bring up the window menu.
Click ADJUST: 1. If the window contains a selection then it is resized.
2. If the window contains a cursor then a selection is
formed between the cursor and the click position.
3. The cursor is moved to the last used position (the hollow
square if neither of the above apply).
Drag SELECT: Selects a new region.
Drag ADJUST: Resizes the current region.
(in either case holding down CTRL leaves the cursor unmoved).
Double click SELECT: Select a word.
Treble click SELECT: Select a line.
Quadruple SELECT: Select a paragraph.
Quintruple SELECT: Select the whole text.
A.2 How to redefine more keys
-----------------------------
At the start of the 'keys' file, the keys for keymap 0 (the default key map)
are defined. Each line is of the form "comment &xxx command" where 'comment'
is any text without a '&' describing the key, 'xxx' is the number of the key
in hexadecimal (Zap key number - see below), ' ' is any number of spaces and
tabs, and 'command' is the command (or list of commands) to be attached to
that key. You may edit the file to add/remove keys as you please. If a key
is not mentioned in the keys file then it is passed on to the next task. Thus
DO NOT put F12 in the 'keys' file (or if you do then bind it to the command
SUSPEND :-).
A list of the valid commands you can use and their actions is given in the
file 'HelpData' within the 'Docs' directory. See also the file 'Commands' for
the syntax to use. To summarise these details, string parameters must be in
double quotes (or omitted if you wish the minibuffer to be opened), and
commands can be strung together with the ':' separator (as in BASIC).
The Zap key numbers lie in the range &000-&1FF and are based on those
returned by Wimp_Poll. Thus, the function keys return &180-&1FF, as
documented in the PRMs. Just look at the 'keys' file if you don't have a copy
of the PRMs. Standard characters return their ascii value &20-&FF as usual.
&7F stands for unshifted DELETE. Internally Zap uses some extra codes in the
range &00-&1F and &100-&17F which differ from the Wimp's. These are
documented in the file E-Keycodes in the docs directory.
Example: Suppose you wished ctrl-] to enter the code &1D into the file. Then
you would enter the line: "c] &12D CHAR &1D".
The keys c0-c9 and sc0-sc9 have been left intentionally blank. I suggest
these are used for user commands/macros or binding the learnt sequence to via
cF8. See the section A.5 on how to define multiple keymaps and switch between
them.
A.3 Changing the default options
--------------------------------
The Zap menu you get when you click the MENU button on a window contains the
status for that window only. Any options changed on this menu will be lost
immediately the window is closed. To change any option permanently, use the
'options' menu obtained by clicking on the Zap icon on the iconbar. After you
have changed the option on this menu click the 'save options' entry.
Alternatively, set up a window the way you like it and then use the 'Copy
ops' menu option on the misc menu to make these options default. This doesn't
work with some 3rd party mode specific options so you should use the options
menu instead in this case.
Please note that some options are stored MODE dependantly. To change these
options it is first necessary to SWITCH TO THE MODE WHOSE OPTIONS YOU WANT TO
CHANGE ON THE OPTIONS.MODE MENU. The options you need to do this for include:
1) Display width.
2) Line number status.
3) Auto indent status.
4) Line edit/Non standard edit status.
5) Hex entry and Overwrite status.
6) Tab display status.
7) Colours.
8) Automatic space stripping on saving.
9) Tab insert status.
10) Auto-width status.
When you change mode, the other options menus will be updated to give the
status of the flags for this mode.
Example: To turn the line numbers off in Basic editing mode use the sequence
of clicks:
zap.options.mode.basic
zap.options.display.linenumbers.none
zap.options.mode.text
The mode set on the 'Options.Mode' menu will also be the mode used for
loading files whose type is not recognised, or when you hold down the CTRL
key. In general you should always put this mode back to TEXT after changing
options of other modes.
Other options that are saved by clicking Save Settings include:
1) Whether searches are case sensitive or not.
(and other options in the Search box)
2) Whether quick print adds a title header or not.
To change the size of an opened window for mode n, create a template in the
current template file (see the !Run file to see which one is loaded) called
mode_n. The size and position of this template determines the opening size
and position (modulo stacking) of your window. The other template flags are
not looked at.
Some other options are stored in the 'keys' file. The file entries are in the
form: "<comment> &xxx <arg1> <arg2> ... <argn>" where 'xxx' is a number I
will call the key variable number. The variable numbers in the keys file are
documented below:
&000-&1FF The default keymap.
arg1=the command attached to that key code.
&200-&20F These give the 16 search macros.
arg1=the macro string (up to 3 chars)
arg2=the replacement string.
&300 The date format to use for scD.
arg1=format string as used by the SWI OS_ConvertDateAndTime
&301 The time format to use for scT.
arg1=format string as used by the SWI OS_ConvertDateAndTime
&302 The default font name to use in font display modes.
&303 The number of blank lines to leave at the end of a window.
&304 The default font size in points.
&305 The number of pixels to shave off the top of a font char.
&306 The number of pixels to shave off the bottom of a font char.
&307 The codes to send to the printer at the end of a line for
'quick print'. arg1=string to be GS transed.
&308 Number of characters to keep cursor from the left margin.
&309 Number of characters to keep cursor from the right margin.
&30A Number of characters to keep cursor from the top.
&30B Number of characters to keep cursor from the bottom.
&30D Right hand margin in pixels.
&30E Filetype of file to be created when SELECT clicked on
the iconbar.
&30F Filetype of file to be created when ADJUST clicked on
the iconbar.
&310 The number of pixels to shave off the left of a font char.
&311 The number of pixels to shave off the right of a font char.
&314 The minibuffer size in characters.
&315 The default indent string.
&316 Flashing cursor on period in centiseconds.
&317 Flashing cursor off period in centiseconds.
&318 Minimum auto-width width
&319 Maximum auto-width width.
&31A Name of the Zap font to use in low-res modes.
&31B Name of the Zap font to use in hi-res modes.
&31C Default attributes to use for newly created files.
&400 The number of the default key map (usually 0).
&4xx (xx<>0) Range of keymap xx (see A.5)
arg1=smallest Zap keynumber to be supported
arg2=largest Zap keynumber to be supported (inclusive)
&5xx These say which mode to load a file on dependent on the path.
arg1=filetype to match (-1 for match any)
arg2=filename to match - the string can contain any of
the wildcards documented under searching.
arg3=[+]<mode name> as for arg1 in the 1xxx's below.
NB The order in which the names appear is important - the
first match will be taken.
&1xxx These specify which of the Zap modes a file of filetype xxx
should be loaded in as (when CTRL not pressed).
arg1=[+]<mode name>
If the optional '+' is present then the file will be loaded
even if SHIFT is not held when you double click.
The mode name is CASE SENSITIVE.
Place the &1xxx variable before the &5xx ones if you want
the filetype to be checked before the pathname.
&2000 As for &1xxx, but the mode to use for UNTYPED files.
&10000+ These specify alternate keymaps (see A.5).
&y0xxx arg1=the command to be mapped to key with code &xxx in
keymap number &y.
A.4 Differences with RISCOS 2/3/3.5
-----------------------------------
DYNAMIC AREAS: Zap uses dynamic area storage for files and fonts on RO3.5. It
uses the wimpslot in earlier versions of the OS.
FONTS: If using fonts on RO2, then Zap will need the outline font manager vsn
2.42. This is used by Impression and other DTP programs.
TASKWINDOWS: If using task windows, on RO2 then Zap will expect to find the
module 'Task' in the System:Modules directory. This should be the Task module
supplied with DDE. Of course ^F12 will not bring up the taskwindow on Risc Os
2. I'm sorry about this, but it's a lot of hassle for me to find a Risc Os 2
machine to work on. You can always map ^F12 to the command TASKWINDOW.
LOADING FILES: Only left shift double click will load a non text file in RO2.
Right shift is deliberately not tested for as some people use it for other
things. I have no control over this on Risc Os 3.
HELP: There is no interactive menu help in RO2. You will have to read the
HelpData file directly.
A.5 Multiple keymaps / the Emacs keymap.
----------------------------------------
Zap can support several keymaps at once. Each keymap is numbered 0-255.
In the default 'keys' file, keymap 0 is the standard Zap keymap and keymap 1
an Emacs emulation keymap. Keymaps 2-4 form part of the Emacs keymap as I
will describe below. To switch to keymap n, use the command "BASEMAP n" (by
pressing Ctrl-Escape or binding the command to a key). The commands
DEFAULTMAP and EMACS act as BASEMAP 0 and BASEMAP 1 respectively.
The default keymap to use when Zap starts up is given by variable number &400
in the keys file. Set this to 1 if you wish to use the Emacs keymap all the
time.
To define a new keymap, keymap number &yy say, you need to do two things.
First you must enter a line in the 'keys' file reserving space for the keys.
This takes the form:
&4yy &aa &bb
where &aa is the smallest keynumber you wish to use and &bb the largest
(inclusive). See entry &401 for an example.
Next you must define the keys. To define key number &xxx you must enter a
line in the 'keys' file of the form:
&yy0xxx <command>
where <command> is the name of the command to be attached to the key. The
format of the <command> field is described in A.1 and the 'Commands' file.
By using multiple keymaps you can provide for a sequence of keys to execute a
command. To do this you need the 'KEYMAP' command. The command 'KEYMAP n'
switches the current keymap to 'n'. However, after the next key has been
read, the current keymap is restored to whatever basemap you have set with
the basemap command. Thus in effect, the keymap only changes for the next
keypress (unless that two has a KEYMAP command).
For example, in Emacs "Ctrl-X 4 F" loads a file. This is accomplished by
setting:
Ctrl-X in keymap 1 is bound to KEYMAP 2
4 in keymap 2 is bound to KEYMAP 4
F in keymap 4 is bound to FINDFILE
After the command FINDFILE has been executed, the keymap will be restored to
1 for the next key press.
A.6 Colour
----------
Colour is changed using the 'Colour' menu off the 'Display' menu, both on
the main Zap window menu. The first 9 colours you can change are the same
for all modes, being:
Colour Action
0 Background1 The colour used for squares containing no text.
1 Background2 The colour used for squares containing text.
2 Foreground The standard foreground colour.
3 Selection-B Selection background colour.
4 Selection-F Selection foreground colour.
5 Cursor-Bac Cursor background colour (ie the cursor colour).
6 Cursor-For Cursor foreground colour.
7 Line nums Colour used for line numbers (eg in Basic mode).
8 Ctrl chars Colour used for control characters (0-31).
Colours 9+ are mode dependant and lie below a dotted line. If the 'all modes'
flag at the top of the menu is set then when you change one of the colours
0-8 (as above) then it is changed for all modes, not just that one mode.
Colours 9+ only set the colour for that mode regardless of the status of this
flag. You will need to change modes to set up the colours for different modes
differently.
Of course, if you change colours from the window menu, then the colours are
only changed for that window and are lost when the window is closed. To
change them permanently, use the Display menu off the options menu and then
click on 'save options' (or use the Copy Ops menu option).
*************************************************************************
* Section B: Loading,Saving,Printing,Editing files *
*************************************************************************
B.1 Loading/creating files
--------------------------
These are the ways to load a file into Zap:
(a) If the file is a text file then double click on it.
(or more generally if there is a '+' for this type in the keys file).
(b) If the file is typed then hold down left shift and double click on it.
(c) If the file is untyped then drag it onto the Zap icon on the iconbar.
(d) Press F2 then type the name of the file and RETURN (TAB completes the
filename).
When you load a file into Zap, it works out the best mode to load it into. At
the moment there are two mechanisms for doing this, both specified in the
'keys' file. These are: (see A.3 for more details).
(i) By filename: The keys variables &5xx are followed by a filetype then a
filename and then a mode to use. If the (wildcarded) filename matches
and the filetype matches then that mode is used.
(ii) By filetype: The keys variable &1xxx is followed by the mode name to
use for type &xxx. If the name is preceded by a '+' then the file is
loaded even if shift is not held.
If the file satisfies more than one of the above criterion, then the first
one mentioned in the keys file will be used.
Sometimes you may wish to load a file in a mode other than its default one.
To do this, set the required mode on the 'Options.Mode' menu, and then hold
down the CTRL key while loading the file. (Eg Shift-Ctrl double click on the
file). It will then be loaded in the selected mode (usually text).
Dragging a file into an open window inserts the data at the current cursor
position. RAM loads/saves are fully supported and you may even save a file
into itself. If you are short of memory then I suggest you switch the undo
buffer off before performing such drags. (Use the File menu).
In any mode the window title is of the form:
"<filename> [*] ([mode name] [options]) [view number/number of views]".
The title is centered unless the window is small when it is right aligned so
you can see the leaf name and options of the file. A '*' indicates that the
file has been altered since last saved. The options characters are described
below. The view number is only shown if you have more than one view on a
file.
R Read only and fixed as read only.
r Read only but can be toggled to read/write by scR.
u Undo supported by this file (so cX acts as cut, not delete).
o Overwrite mode active (toggle via Insert key).
h Hex entry mode active for Byte/Word (toggle via F2).
w Wordwrap mode active (toggle via cF5).
l Line edit mode active (return inserts new line).
a Auto indent mode active (see the Edit submenu).
n Non standard mode active (used by ARMBE emulation mode).
L Line wrap mode.
D This is a DOS text file (LF->CRLF on saving)
S This is a Spool text file (LF->LFCR on saving)
You may also create files of a given type using the 'Create.Type' menu, or
grab modules using the 'Create.Getmodule' menu. Zap can also read disc
sectors and other applications memory. Click SELECT on the Zap icon to create
a new text file and ADJUST on the Zap icon to create a new BASIC file. You
can change the type of file created by SELECT/ADJUST click in the 'keys'
file.
Zap will warn you before overwriting a file of the same name if it is
altered. If it is unaltered then the newly loaded file will replace the one
currently loaded as in !Edit.
When a file is loaded, OS_FSControl, Canonicalise_Path will be called to
convert any path references into full path names (unless you have RISC OS 2).
B.2 Saving files and ~ backups
------------------------------
Press F3 (or click on the menu option 'File') to open the save box. You may
change the file type either by clicking the MENU button, or by moving to the
type name window, typing the new type name and pressing RETURN. Zap will warn
you if you are about to overwrite a more recent file (if you have the
check-dates option on - see the options.misc menu), or if the file contains
no path. If you ignore the warning then it will save the file to the
currently selected directory.
Ctrl-F3 (or clicking on 'File.Save') does a direct save. Ctrl-F2 deletes the
current file and Shift-Ctrl-X deletes the other file being viewed. Please
note that when the SAVE,DISCARD,CANCEL box pops up you may simply press
'S','D',or 'C' instead of using the mouse. The same holds for other dialogue
boxes (ctrl S,D,C are also valid).
If the directory in which the file is saved contains a directory called ~ or
~<num> where <num> is any number then instead of the file simply being
overwritten, the old version is moved into the ~ directory. If you have
multiple ~ directories - eg ~1,~2,~3 ... ~n then the last n versions of the
file are kept.
If you are using one of the basic modes then please note that you must save
from a window in the correct mode. If you switch to text mode and then save,
your file will be saved as a text file and not a Basic program.
B.3 Dumping, printing files
---------------------------
First note that any window display may be turned into a text file simply by
pressing SHIFT-CTRL-COPY. Once you have done this you could print a file
simply by saving it to a printer driver, or by opening the 'printer:$' filing
system (press ctrl-print) and saving the file into it. Zap also provides two
other printout commands.
The first, 'quick print' can be got by pressing the 'Print' key. When you
press Return, or click 'PRINT', it will send the display to the printer
directly. It sends a LF and a CR to the printer at the end of each line. You
may configure the codes sent by altering the 'keys' file variable &307.
The second, 'fancy print' can be got by pressing 'Shift-Print'. You must have
a printer driver loaded. The file will then be output via the printer driver
in the current outline font selected via the 'Display.Font.Othername' menu.
This option still has problems - especially with Computer Concepts Turbo
drivers. It is probably better to save the file onto the printer driver
directly.
B.4 Selecting regions
---------------------
There are several ways to mark regions in Zap. The most obvious is to use the
mouse.
If there is no region selected then DRAG SELECT will mark a new region, and
ADJUST CLICK/DRAG will select between the clicked point and the cursor. If
there is already a region selected then DRAG SELECT will start selecting a
new region, ADJUST CLICK/DRAG will alter the old region. In either case, hold
down the CTRL key to leave the cursor unaffected by the selection.
The second method is to use the keyboard. This method is much faster when
you have got used to it. First move to the start of the region you wish to
mark. Then press CTRL-COPY and move (via the cursor keys) to the end of the
region. Then press ESCAPE (or CTRL-COPY).
The third method is to use multiple clicks. Double click marks a word, triple
click a line, quadruple click a paragraph and quintuple click the whole
file. If you do a drag selection after the second/third click, then the text
will be selected in words/lines. Note that the BASIC mode limits selected
regions across lines to full Basic lines (like the ARMBE).
B.5 Copying/pasting/cutting/yanking
-----------------------------------
Zap implements both the !Edit style copy/move and the Emacs style paste/yank.
The !Edit method: To move a region to the cursor position press ctrl-V. To
copy a region press ctrl-C.
The Emacs method: To move a region cut it with ctrl-X and then paste it with
ctrl-Y (the undo buffer must be on to do this). To copy a region, grab it
with shift-ctrl-W (Emacs meta-W) and paste it with ctrl-Y. Press shift-ctrl-Y
(Emacs meta-Y) to cycle through the previously deleted regions. Also note
that multiple presses of ctrl-K or F10 produce data which can be yanked by
ctrl-Y.
Another way to copy text is via the COPY key. This is faster for copying
small sections of other lines. First press the COPY key to split the cursor
into two. One cursor can be moved about by the cursor keys. Move this to the
area you wish to copy from and press the COPY key once for each character.
Press ESCAPE or RETURN to cancel the copy mode. Please note that you can also
use this method across windows and even across modes!
B.6 Inserting text/control codes
--------------------------------
In text mode there are two features to help you format text as you type it.
The first is called 'word wrap' and is toggled on and off via cF5. The second
is called 'line wrap' and can be toggled on and off via the 'Edit' menu (or
you can bind the LINEWRAP command to a key if you wish). Whilst either of
these modes are active, text typed beyond the 'wrap width' margin (set via
the 'Edit' menu) is automatically split at spaces and placed on the next
line. 'Wordwrap' differs from 'linewrap' in that when you delete characters,
the paragraph will be formatted in wordwrap mode (thus pulling text back) but
not in linewrap mode.
There are two ways to insert control characters. The first is to 'quote' the
character. To do this, press ctrl-Q and then type the control character you
want to insert. Eg, ctrl-Q ctrl-A will insert the byte 1. The second is to
switch to byte mode (scF2), type the digits in hex and then switch back to
text mode (scF1). This assumes that 'hex entry mode' is active in byte mode.
When creating macros, by binding a list of commands to a key, you may find
the commands INSERT and INSERTGS useful. The first inserts a string into the
text and the second GS-Trans's it first.
*************************************************************************
* Section C: Editing BASIC - PLEASE READ *
*************************************************************************
C.1 Changing editors/options
----------------------------
There are essentially 3 ways to edit basic programs in Zap. Do not be put off
if you dislike the default configuration. You may change most things to your
preference.
In the default configuration, basic programs are edited in the Zap extension
mode called BASIC. This is designed to be a desktop version of Acorn's ARMBE.
Those people used to ARMBE should find this mode very easy to use. The
program is edited while tokenised and line numbers are shown in the margin
and updated when new lines are inserted.
Return and delete act differently from ARMBE, acting as they do for the
standard text mode (this is called stream editing). If you wish them to act
precisely as in ARMBE then switch on the 'lineedit' and 'nonstandard'
options. They will then act in a 'line editor' fashion with Return inserting
a new line rather than splitting the current one. The functions Split and
Join (sF1 and cF1) can then be used to split/join lines.
For those people who wish to edit BASIC in tokenised form, and thus with line
numbers accessible, but don't want to see them in the margin, they can be
switched off. Perform the option changes indicated by the clicks:
options.mode.BASIC ; configure basic mode
options.display.linenumbers.none ; turn off line numbers
options.mode.TEXT ; return config mode to text
options.save options ; save your Config file
For those who prefer to edit basic in detokenised form, there is a separate
mode named BASTXT which accomplishes this. To load a single file in using
this mode it is easiest to set the options menu mode to BASTXT and hold down
CTRL key while loading the file. To change to the BASTXT mode permanently,
change the line of the 'Keys' file which reads:
Basic &1FFB BASIC
to read:
Basic &1FFB BASTXT
In this mode, whenever a file is loaded it is converted into text with line
numbers striped. Saving is the converse. Please note that if the program
contained line number references, then Zap will beep before forcing the BASIC
mode described in C.2.
C.2 Using BASIC in ARMBE mode
-----------------------------
In it's default setup the BASIC mode is designed to emulate ARMBE. Thus line
numbers are displayed in the left margin, and automatic renumbering takes
place as lines are added to the file. All GOTO and GOSUB line number
references are automatically updated.
In line editor mode, the RETURN key inserts a new logical line. To split the
line in two at the current cursor position press SHIFT-F1 and to join two
lines press CTRL-F1. When two lines are joined, a ':' is inserted between the
statements. If you do not like this, it can be switched off by turning off
the line-edit and non-standard flags on the edit menu. See above.
Text is typed as usual with the proviso that tokens are automatically
expanded. For example 'P.' will be expanded to 'PRINT' when you press the
dot. Also note that in non-standard editing mode excess spaces are
automatically removed from the end of a line (except when this would prevent
the line wrapping onto the next). 'Unix' tab mode just advances the cursor to
the next tab stop as in ARMBE. The other tab modes, !Edit and Coltab work as
in the text mode.
Copying bits out of the middle of lines is performed using the COPY key.
Groups of lines are selected, cut and moved/copied as usual for any text
region. The regions are automatically renumbered internally. For those (like
me) used to the ARMBE way of moving regions, there is a natural replacement.
For example suppose you wish to move lines 10-50, to before line 100. In the
ARMBE you would do:
Move to line 10, cM cM, move to line 50, cM cM, move to line 100, cB, f12
In Zap you do:
Move to line 10, cCOPY, move to line 60, ESCAPE, move to line 100, cV
Goto's are automatically updated. For example copy the lines 10 and 20 below
several times in a basic program.
10 PRINT "HELLO"
20 GOTO 10
Shift-F8 renumbers any program in steps of 10. Please note that line numbers
are not stored in the undo buffer as this would be a waste of space. Thus
after multiple undo's, the line numbers may get out of order. This can be
rectified by Shift-F8. Basic programs can be appended by simply dropping them
into the window.
C.3 Testing BASIC programs
--------------------------
Zap provides a number of functions to test out basic programs while they are
being edited. The first 3 start up a new BASIC task and ram transfers your
program to the new task, loading it a PAGE:
scB This drops you into basic with your program loaded at PAGE.
scU This acts as cB and then Runs the program.
scF This acts as cU but automatically quits BASIC when finished.
The other two commands save the program first, and then run them from disc.
These are of course slower:
scC This acts as cU but saves the program first and chains it from disc.
scE This acts as cF but saves the program first and chains it from disc.
Zap calculates the amount of room needed to run the program as the maximum
of: 1) Next slot size 2) Program size+16k 3) Program size * 1.5.
C.4 The cln_Backward error (trouble shooting)
---------------------------------------------
Occasionally, while editing Basic programs in the tokenised BASIC mode, you
may get an error 'cln_Backward'. This essentially means that the BASIC
program has become corrupted in some manner and it can't redraw the screen -
usually the line numbers have got out of sync.
If you get this error then do not panic! The easiest way to save your program
is to switch immediately to text mode (scF1) before doing anything else. Save
it as a text file (if you wish), move to the top of the file and then switch
back to BASIC mode (via scF6) renumber and then save the program. You may get
the impression that an infinite sequence of errors occurs, so that you
cannot switch to text mode. This is not the case, it's just that the window
is not redrawn properly so the error box stays on the screen even after you
have cancelled it - see if the OK icon gets highlighted when the mouse passes
over it.
I have not yet tracked down all the possible causes of this error yet. The
most common is selecting regions via the mouse using 'Adjust'. It is much
better to use the keyboard selection (via cCopy).
*************************************************************************
* Section D: Individual mode help *
*************************************************************************
Zap can handle up to 256 text processing modes. I have currently allocated
space for 16. For details on how to write your own mode see the 'Docs'
directory. The currently defined modes are described below. Additional help
is given in the 'HelpData' file.
D.0 Text Mode
-------------
This is a basic text editing mode. Most of the functions associated with this
mode are detailed elsewhere. See the 'Helpdata' file for a detailed listing
of menu options. To insert control characters in the text it is easiest to
switch temporarily to byte mode. The character &09 in a text file is taken to
denote a tab to next column of 8. You may change this character and the way
it is displayed from the display menu. Tab action may be changed by the
'Misc.Tabs' menu.
D.1 Byte Mode
-------------
This mode gives displays the file in hex bytes and is used for examining data
or inserting control characters. The hex-entry flag (toggled by shift F3)
controls this action. If it is off and you type '0B' then the letters '0' and
'B' will be inserted. If hex-entry is on (h in the title) then the byte &0B
will be inserted. Use the overwrite mode (toggled via the insert key) to
change the data without shifting the file.
D.2 Word Mode
-------------
This is similar to byte mode except the data is shown in word form. Typing
characters with hex-entry mode off has no effect, but typing with it on
inserts the given word in hex.
D.3 Ascii Mode
--------------
This mode displays data in ascii dump form. Letters typed are inserted as
usual.
D.4 Code Mode
-------------
This mode displays data in disassembled format with 1 instruction per line.
Please note that in RISCOS 3, the debugger adds some extra information after
some instructions, but some of this only appears if you disassemble
sequentially. Eg TEQP R0,#0 followed by MOV R8,#0 gives the warning 'Not
r8-r14'. However this may vanish if you are moving backwards up the file
instead of forwards. This happens very rarely but it may cause confusion if
you don't understand what's happening.
The four most useful keys in code mode are cI,Left,Right,Return. For example
if you are at the start of a module then pressing cI will cause you to jump
to the start offset of the module. If you are on an instruction 'BL
&00012345' or 'ADR r0,&01822445' then pressing Right will jump to the
indicated address. At any time, Left will move you back to your previous
position. This jumping uses the marker buffer and can be done to any depth
you require.
The RETURN key enables you to edit an instruction (via the ASSEMBLE command).
When you press it, the minibuffer will be opened with the current instruction
entered as default. You should then edit the instruction and press RETURN
again for it to be assembled and written back. The assembling is done by the
ZapBasic module which tokenises the instruction and then uses the BASIC
assembler. Hence you may use the basic functions ASC,EQUD,ADR etc.
If the file is typed 'Module' then the first few offsets display the module
entry point name rather than the instruction.
D.5 BASIC Mode
--------------
See sections C.1, C.2 and C.3 for details about how to use this mode.
A slight modification is made to the BASIC program on loading. The actual
file format edited is a number of lines of the form:
xx yy zz "Tokenised line" &0D
Where xx yy zz is the line number in 3 byte text form as stored after a GOTO
or GOSUB statement.
D.6 BASTXT Mode
---------------
This edits Basic files in detokenised form. See sections C.1 and C.3 for
details.
D.7 CMODE Mode
--------------
This mode provides facilities for editing C, TeX, and Gopher files including
bracket/dollar matching and function listing. The mode is written by Bryan
Scattergood. Please see the directory '3rdParty.BryanS' for details about
this mode.
D.8 C Mode
----------
This provides a coloured C mode. See the directory '3rdParty.Ebourne' for
more details.
D.9 Assembler Mode
------------------
This provides a coloured Acorn Assembler mode. See the directory
'3rdParty.Ebourne' for more details.
D.10 Pascal Mode
----------------
See the directory '3rdParty.Ebourne' for more details.
D.11 THROWBACK Mode
-------------------
This mode handles the files generated by Zap's search to buffer, C throwback
and !Find info output. Double clicking on an item will jump to that item in
the source file. Shift double clicking will jump to the item and then kill
the throwback buffer. Clicking ADJUST on a line will remove the line from the
file. Treble clicking will move to the match and then bring the window to the
front of the window stack.
Also note that RETURN acts in the same way as double click and DELETE in the
same way as adjust if you move into the file.
D.12 Taskwindow Mode
--------------------
This mode handles task windows. To create a task window use the
'Create.Taskwindow' menu option or press ctrl-F12. At any time, changing mode
to TEXT will suspend the task, and changing mode back to TASKWINDOW will
resume it. The taskwindow output supports the COPY key and the following VDU
actions:
07 CTRL G Bell.
08 CTRL H Move back one character.
09 CTRL I Move forward one character.
10 CTRL J Move down a line.
11 CTRL K Move up a line.
12 CTRL L Clear text window.
13 CTRL M Move to line start.
22 CTRL V Change mode.
26 CTRL Z Restore text window.
28 Define text window.
30 Home cursor.
31 Move to x,y (TAB).
If you use Olly Betts' wonderful 'Line Editor' module then you'll find it
works within a Zap taskwindow. See the 3rdParty.Lineeditor directory for the
latest version. Mode changes are reflected by changing the width and height
of the window.
In general control-letter keys are passed on to the task window and function
keys are not. The following commands (usually bound to the bracketed keys)
are never passed on: Copy (Copy) Copysel (^C) Movesel (^V) Paste (^Y)
Clearsel (^Z) Quote (^Q). You can use ^C to copy commands to the active
task. If you want to send a control key or function key to the taskwindow
(which is not normally passed on) then this can be done by quoting it with
CTRL-Q. For example, CTRL-Q F1 will cause function key F1 to be expanded in
the taskwindow.
D.13-D.31 These modes are reserved
----------------------------------
*************************************************************************
* Section E: Search and Replace *
*************************************************************************
E.1 The Search window
---------------------
Zap has quite a powerful search facility which is based loosely on emacs
search, allowing 'OR' constructs and character ranges. The search window can
created by pressing F4 or F7 or using the 'file' menu. Pressing F4 will
ensure that search matches are jumped to, whereas pressing F7 will cause all
matches to be placed in a separate throwback buffer. Double clicking on a
match in the buffer then jumps to the match. See section D.11.
The first column of the search window selects various search options. These
differ from earlier versions of Zap.
'Raw search' - If this option is ON then the whole file will be treated as a
single line of text and searched accordingly. Thus \< will match the start of
the file only and \> the end of the file. A search will produce the same
result regardless of the mode a file is in. If this option is OFF then the
file is searched in lines. This means that \< matches the start of a line and
that you cannot match across lines. In Basic mode the lines are detokenised
so that you can match PRINT and substrings of it. In Code mode the lines are
disassembled so that you can match substrings of instructions.
'Case sensitive' - If this option is ON then strings of letters will only
match if their case agrees. If it is OFF then strings will match regardless
of case.
'Use macros' - In order that the user may have any search syntax he/she
chooses, I have adopted the following approach: 1. All wildcards/commands
begin with a '\' as listed below. 2. The user may define up to 16 macros
(aliases) in terms of these commands. 3. When the search string is entered,
all the user's macros are substituted before the search takes place. The
macros may be examined and altered by clicking on the 'Show Macros' button.
If this option is switched OFF then the macros are no longer substituted when
the search string is entered. The default macro definitions are stored in the
'Keys' file and may be altered there. (For example; I have * as a standard
macro for \.\*. Thus if I typed in a*b, the string would be converted to
a\.\*b. However a\*b would remain as a\*b as the * follows a \ and is thus
treated as a command.)
'\' commands - If this option is switched OFF then \ will match the character
\ and not introduce a command (like \10). Hence, none of the commands below
will work.
The second column selects where the search should start and the direction of
the search. You may start at the beginning of the text or forwards/backwards
from the current cursor position, or search through all files (forwards from
the start of the first file in the stack).
The third column selects the output. If the 'to Window' option is OFF
(F4) then the cursor will be moved to the first match and subsequent matches
may be got by sF7 (Next match) and scF7 (Previous match) as in the Basic
Editor. A beep will sound if there are no more matches and the cursor will
not move. If the option is ON (F7) then all matches are placed in a new
(text) file. Double clicking on entries in this text file cause the cursor to
be moved to the corresponding match.
All these options can be toggled by using ctrl-letter keys where 'letter' is
the first capitalised letter of the option or ctrl-\ in the case of \
commands.
The table below details all the escape characters and commands. In it I will
use 'x' to stand for any ascii character unless otherwise mentioned.
x Matches character 'x' (according to case sensitivity).
\x Matches 'x' case sensitively, unless \x mentioned below.
`x Matches 'x' only (without any replacement of macros).
\( \) Act as brackets for nesting expressions.
\{ \} Act as the normal brackets above, but may be referred
to in the replace string during a search and replace. See E.2.
\# Matches any character. Eg a\#d matches 'and','aad' but not 'ad'.
\. Matches any character except the return character.
\* Matches any number of the previous expression. Eg fo\* matches
'f','fo','foo' etc. and \(and\)\* matches '','and','andand' etc.
\% Matches the most number of repetitions of the previous expression.
Thus \[0-9]\% matches '1' in '1pt' and the '395' in 'ab395rty'.
\| Matches one expression OR another. Eg hello\|goodbye\|fred.
Eg \(a\|b\)\* matches 'abababa','abbba' etc.
\[..] Matches a range of characters. Eg \[a-zA-Z%] matches any letter or
a '%'. If a '^' is given after the opening bracket then
it acts as a NOT. Thus \[^abc] matches any character except a,b,c.
\< Matches null string at line start (and file start).
\> Matches null string at line end.
\+ Turns on case sensitivity for the following letters ONLY. It's
effect stops at the next wildcard/bracket/command. It doesn't
affect nested/bracketed statements - this will be improved.
Eg \+Fred\|Bill matches Fred case sensitively but not Bill.
\- As above, but turns off case sensitivity.
\\ Matches a '\'.
\ddd Where d is any decimal digit matches that number.
Eg '\0alf' matches byte 0,'alf' and \233 matches byte 233.
Please note that \999 matches byte 99 followed by '9' as 999>255.
\&hh As above but matches the hex byte hh when h are valid hex chars.
\A-\Z Match ctrl A to ctrl Z.
\a Matches alert (7)
\b Matches backspace (8)
\f Matches a form feed (12)
\hdd... Where d's are hex digits. Match the given word (32 bit number).
\n Matches a new line (10)
\o Matches any character except a '.' (useful for matching filenames).
\r Matches a return (13)
\t Matches a tab (9)
\v Matches a vertical tab (11)
\wdd... Where d's are decimal digits. Match the given word (32 bit number).
\xhh Matches hex numbers as above (where 'x' is the letter 'x').
In the examples below, the default macros are assumed. Please note that you
may macro the macros! Eg, you could define '(' to be '\(' and '\( to be '('
if you wished.
Examples:
cat\|mat Matches cat or mat.
re*ment Matches any occurrence of 're' then 'ment' on a line.
SWI Matches any SWI (in code mode).
LDR\|STR Matches any load or store instruction.
R6 Matches any instruction using R6.
BL*&0000A95C Matches any call to &0000A95C.
\&0A Matches the byte &0A.
\<fred Matches fred, but only at the start of a line.
main`( Matches 'main('
\d\% Matches any number (where \d is macroed as \[0-9]).
Hints:
The search will be MUCH faster if you give a definite first character to
start with. Eg 'a\(nd\|pple\)' will be a lot faster than 'and\|apple'.
If the search takes longer than 1/3 second, then an hourglass will come up
displaying the position in the file as a percentage underneath. You may stop
the search by pressing Escape, and the partial results will be displayed if
you are using 'Search to buffer'.
E.2 The Replace window
----------------------
A Search and Replace window can be created by pressing shift-F4 or from the
'file' menu. The first two columns are as for the Search window. The third
column selects either selective or global replace.
For a selective replace (the global option OFF), each match will be
highlighted and a 'Replace ?' window will appear. Press 'R' to replace that
match and move onto the next match. Press 'S' to skip to the next match
without replacement. Press 'T' or 'E' to replace all matches from this point
(inclusive) to the end of the file. Press 'C' or ESCAPE to stop the selective
replace.
The format of the search string is described in section E.2. In the replace
string you may also use the following control sequences:
&n Replace with the n'th \{,\} expression in the search string (n<10).
&& replace with an '&'
If you wish to include parts of the match string in the replacement string
then you must surround the relevant sections in the search string with \{,\}
type brackets.
Examples:
Search string: Replace string: Action:
'cat' '' Removes all occurrences of 'cat'
'\{cat\}' '&1s' Replaces 'cat' with 'cats' preserving case.
'time=\{\#\}' 'time is &1' Replaces 'time=58' with 'time is 58' etc.
To convert spaces between columns of figures in a table into tab characters
make the find string '\{\d\} \*' and the replace string '&1\9'. Another way
to do this is replace '\{\d\} \%' with '&1\9'.
E.3 Keyboard (incremental/interactive) search
---------------------------------------------
Incremental search is activated by pressing ctrl-S (Search forward) or ctrl-R
(Reverse search). When you do this a minibuffer will be opened for you to
type the search string into. As you type the search string, Zap will
search through the text placing the cursor at the end of the next match.
If there is no match then Zap will beep and print "(fail)". You may use the
DELETE key to remove characters from the search string.
To halt the search at the current position, press Escape or Return. If you
press an arrow or function key then the search will be halted and the key
then acted upon. Alternatively, pressing cG (Cancel) will cause the search to
be cancelled and the cursor returned to its initial position. This setup
should be familiar to users of Emacs.
Pressing ctrl-S or ctrl-R whilst in search mode will move you to the
next/previous matches. If the search string was empty then the previous
search string will be placed in the buffer.
Macros are turned off during the search so ('s etc act as normal. However,
\( and all other \-starting commands will still work so you must type \\
to search for a \.
*************************************************************************
* Section F: Other features *
*************************************************************************
F.1 Learning key sequences
--------------------------
This feature of Zap is very simple to use, and very useful. To start
'learning' a key sequence, simply press ctrl-L. Type the sequence you wish to
learn and then press ctrl-L again. Press F1 to execute the learnt sequence.
Note firstly that Zap will beep after every keypress you make to remind you
that it is being stored. Secondly note that the ESCAPE key will NOT stop the
learning process. Only ctrl-L will stop it. Thus you can learn sequences
which use incremental search, or keyboard selection of regions. Both these
actions involve the Escape key.
Once you have learnt a sequence, you may 'bind' that sequence to a key so
that pressing that key in future causes the same series of actions to take
place. To do this press CTRL F8 and then press the key you want to bind the
sequence to (or Escape if it was a mistake - Escape won't be bound).
The learn feature has many uses:
Example 1:
Suppose you wanted to insert a tab at the beginning of a group of lines. One
way would be to use the indent region option. Another way however would be to
learn the sequence: TAB,DOWN,CLEFT and then press F1 a number of times.
Example 2:
Suppose you wanted to go to the next match of 'cat' and switch the case of
the letters. You could learn the sequence:
ctrl-S C A T ESCAPE LEFT LEFT LEFT scS scS scS
and then press F1 a number of times.
Exercise (for the reader):
When editing this !Help file I decided to switch the columns labelled 'Key:'
and 'Command:' around in section A.1. I did this by learning a key sequence
and then I only had to press F1 once for each line. What was the sequence?
(no prizes unfortunately).
F.2 Tabs and indenting
----------------------
The standard tab character is taken to be &09. You may alter this from the
'Display.Tabs' menu. This menu also allows you to alter the appearance of
Tabs. The menu 'Misc.Tab mode' controls how tabs are entered when you press
the TAB key. In 'Unix' mode the character &09 is inserted. In '!Edit' mode,
the cursor moves to the column which starts the next word on the above line.
In coltab mode, the cursor moves forward 'n' characters where 'n' is the
current coltab width. In the latter two, as many tab characters as possible
are inserted. If you wish spaces only to be inserted, then tick the 'as
spaces' menu option. Use shift-TAB to switch between 'Unix' and '!Edit' tab
modes.
To indent a region, first select it and the use the 'Selection.Indent' menu
option (or Ctrl J). Type 'n' to indent by n spaces, '-n' to remove n spaces,
or type a string to indent by that string. Use the command OUTDENT to
outdent the region. The region is outdented by the length of the current
indent string (thus a negative indent string will cause outdent to indent
:-).
F.3 Fonts and font sizes
------------------------
The font used in a Zap window is determined by the 'Display.Font' menu. There
are basically 4 options. You may either have (1) a bitmap font drawn by Zap
(2) The system font drawn by the operating system (3) Anti-aliased fonts
drawn by Zap (4) Anti-aliased fonts drawn by the OS.
(1) is the fastest and recommended for normal use. A range of bitmap fonts
are provided.
(3) is still at the experimental stage and contains a number of bugettes.
(4) is very slow.
The configured font is changed in the KEYS file and NOT from the options
menu.
To configure the anti-aliased font name and size, change variables &302 and
&304 in the keys file. You may also use variables &305/306/310/311 to shave
off surplus spacing around font characters. Fonts are monospaced.
When using the FAST FONT option, it should be noted that the font is only
cached in one set of anti aliased colours. These are taken to be the default
colours for text mode foreground and background. All other colours are drawn,
but not anti-aliased.
F.4 Universal arguments.
------------------------
The universal argument feature enables you to execute a keypress an arbitrary
number of times. Suppose for example you wanted to insert 100 spaces. The
quick way to do this is to type:
CTRL-U 100 SPACE
In general you type CTRL-U then the number of times you want the key to be
executed, then press Return, then press the key to execute. The 'pressing
Return' step can be omitted if the key you want to repeat is not delete or a
digit or another valid key for editing the number you are typing (as in the
example above).
F.5 The minibuffer
------------------
Some Zap commands can take parameters. In order that these parameters can
be entered at run time, a minibuffer is provided. If you type a command into
the 'keys' file without specifying its parameter then, when you press that
key, the minibuffer opens. You should type in the command argument and then
press RETURN. Several examples keys are cESC,cS,cR,cW,F2.
Several control keys have default meanings in the minibuffer. These can not
at the moment be reconfigured, but are compatible with the Emacs minibuffer
keys:
cA / cLeft Move to start of line
cB / Left Move back a character
cD / sDelete Delete the next character
cE / cRight Move to end of line
cF / Right Move forward a character
cG / Escape Quit the minibuffer
cK Delete to end of line
cU Clear minibuffer
TAB Complete key (eg after F2, TAB will complete
filenames)
RETURN Execute the command.
If you have the Lineeditor module loaded (version >= 2.67)
Up / sUp Recall line
Down / sDown Next line
cUp First line in recall buffer
cDown Last line in recall buffer
These keys can be redefined by commands, but should remain as consistent as
possible with the above.
*************************************************************************
* Section G: How to find out more *
*************************************************************************
G.1 Other help files
--------------------
The 'Helpdata' file contains help for all the leaf windows, main windows, and
commands. You can view this by using Acorn's !Help application, or just by
loading the text file. On RISC OS 2/3.0 you cannot get help on the menu
entries, only the windows (but you can just read the file directly).
For those interested in writing an extension mode, or adding new commands, or
Zap's internal workings, please look in the Docs directory. You should start
with the file called ReadMe. This directory also contains a Zap keystrip in
the form of a Draw file.
Please see the file 'Changes' for my future plans for Zap.
G.2 Obtaining future versions of Zap
------------------------------------
I will be sending any future versions (>1) of Zap to:
1) Hensa: e-mail: archive-server@micros.hensa.ac.uk (send message 'help')
ftp : micros.hensa.ac.uk (IP 148.88.8.84)
(outside office hours only for those not on Janet)
2) The Archimedes Public Domain Library (run by David Holden):
39 Knighton Park Road
Sydenham
London
SE26 5RN
Please look at the 'Changes' file for the anticipated release date.
G.3 Contacting me with suggestions/bugs
---------------------------------------
Suggestions and bug reports are welcome. See the Copyright file for my
address (E-Mail preferred). Before sending suggestions please read the
'Changes' file. If you find a bug then please give me as many details as
possible as to the circumstances that cause it - try and get it repeatable.
If you have a comment on a Zap extension mode not written by me then please
write to the author (see 3rdParty.ReadMe).
I hope you find Zap a useful program.
Dominic Symes
Oct 1996